var myEnumMemberCount = Enum.GetNames(typeof(MyEnum)).Length;
var count1 = typeof(TestEnum).GetFields().Length; var count2 = Enum.GetNames(typeof(TestEnum)).Length; var count3 = Enum.GetValues(typeof(TestEnum)).Length;